Image converting method and image converting apparatus

ABSTRACT

An image converting apparatus has: a parameter setting unit which sets parameters for converting each pixel of an input image into predetermined chromaticity coordinate values; a chromaticity coordinate converting unit which obtains conversion chromaticity coordinate values obtained by converting each pixel by the set parameters; a color region obtaining unit which obtains a color region including 2-dimensional conversion chromaticity coordinate values obtained by projecting each conversion chromaticity coordinate value onto a unit plane; an area calculation processing unit which calculates an area of the color region obtained every parameter and obtains parameter values at the time of the maximum area value; and an image converting unit which converts the input image by the parameter values. The image data unbalanced in color arrangement of an object is converted into image data obtained under an ideal white light source.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The invention relates to an image converting method and an imageconverting apparatus for converting image data influenced by a coloredlight source upon photographing into image data obtained under an idealwhite light source.

[0003] 2. Related Background Art

[0004] When an object to be photographed is photographed by using, forexample, a fluorescent lamp as a light source, image data in which theobject is bluish is obtained. An image converting method called a grayworld (hereinafter, simply referred to as a gray world) is used toeliminate such an influence of the colored light source.

[0005] According to the gray world, it is presumed that a color obtainedby averaging chromaticity coordinate values of respective pixels of theimage data becomes chromaticity coordinate values showing achromaticgray, and by converting the image data by using such chromaticitycoordinate values showing the achromatic gray, that is, by executingwhat is called a chromatic adaptation conversion, bluishness iseliminated. That is, the gray world is a method of obtaining the sameimage data as that photographed under an ideal white light source inwhich spectra are uniformed as shown in FIG. 6. A technique using thegray world has been disclosed in a patent literature 1(JPA-2002-232901).

[0006] According to the conventional gray world, the conversion isperformed to the image data by using the chromaticity coordinate valuesobtained by averaging the chromaticity coordinate values of therespective pixels. That is, the averaging of the chromaticity coordinatevalues of the respective pixels is performed to obtain average values ofthe chromaticity coordinate values which take into consideration of afrequency of occurrence of the color of each pixel. Therefore, averagevalues of chromaticity coordinate values of image data obtained byphotographing, for example, a small white sandy beach, a blue sea, and ablue sky, as objects, by using a digital camera or the like are notchromaticity coordinate values showing the achromatic gray butchromaticity coordinate values which are deviated to blue and based onblue. Therefore, even if the conversion is executed by using thosechromaticity coordinate values, the image data cannot be properlyconverted into the image data which is obtained under the ideal whitelight source.

SUMMARY OF THE INVENTION

[0007] It is, therefore, an object of the invention to provide an imageconverting method and an image converting apparatus which can convertimage data whose photographed object is unbalanced in color arrangementinto the image data which is obtained under an ideal white light source.

[0008] According to the first aspect of the invention, to accomplish theabove object, there is provided an image converting method comprisingthe steps of: converting chromaticity coordinate values which each pixelof an input image consisting of a plurality of pixels has into a2-dimensional chromaticity coordinate plane and obtaining 2-dimensionalconversion chromaticity coordinate values of each pixel; obtaining anoutline of a color region defined by the 2-dimensional conversionchromaticity coordinate values of the plurality of pixels converted intothe 2-dimensional chromaticity coordinate plane; obtaining 2-dimensionalconversion chromaticity coordinate values, on a 2-dimensionalchromaticity coordinate plane, of a barycenter of an area of a regionwhich is specified by the outline of the color region; and executing acolor conversion of the input image by using the 2-dimensionalconversion chromaticity coordinate values of the barycenter as a newcoordinate origin.

[0009] Each pixel of an input image is converted into 2-dimensionalconversion chromaticity coordinate values obtained by projectingconversion chromaticity coordinate values obtained by converting eachpixel by using parameters for converting into chromaticity coordinatevalues onto a unit plane, in a color region including the 2-dimensionalconversion chromaticity coordinate values, parameter values in which anarea of the color region becomes the maximum are obtained, and the inputimage is converted by the obtained parameter values.

[0010] Each pixel of an input image is converted into 2-dimensionalconversion chromaticity coordinate values obtained by projectingconversion chromaticity coordinate values obtained by converting eachpixel by using parameters for converting into chromaticity coordinatevalues onto a unit plane, parameter values in which a barycenter of acolor region including the 2-dimensional conversion chromaticitycoordinate values is set to ⅓ are obtained, and the input image isconverted by the obtained parameter values.

[0011] The parameter values can be obtained when the barycenter lieswithin a predetermined threshold value including ⅓.

[0012] According to the second aspect of the invention, there isprovided an image converting apparatus comprising: a parameter settingunit which sets parameters for converting each pixel of an input imageinto predetermined chromaticity coordinate values; a chromaticitycoordinate converting unit which obtains conversion chromaticitycoordinate values obtained by converting each of the pixels on the basisof the parameters set by the parameter setting unit; a color regionobtaining unit which obtains a color region including 2-dimensionalconversion chromaticity coordinate values obtained by projecting each ofthe conversion chromaticity coordinate values onto a unit plane; an areacalculation processing unit which calculates an area of the color regionwith respect to the parameters and obtains parameter values at the timewhen the calculated area value becomes the maximum; and an imageconverting unit which converts the input image on the basis of theobtained parameter values.

[0013] According to the third aspect of the invention, there is providedan image converting apparatus comprising: a parameter setting unit whichsets parameters for converting each pixel of an input image intopredetermined chromaticity coordinate values; a chromaticity coordinateconverting unit which obtains conversion chromaticity coordinate valuesobtained by converting each of the pixels on the basis of the parametersset by the parameter setting unit; a color region obtaining unit whichobtains a color region including 2-dimensional conversion chromaticitycoordinate values obtained by projecting each of the conversionchromaticity coordinate values onto a unit plane so that additive colormixture can be performed; a barycenter calculation processing unit whichcalculates a barycenter of the color region with respect to theparameters and obtains parameter values at the time when the calculatedbarycenter is set to ⅓; and an image converting unit which converts theinput image on the basis of the obtained parameter values.

[0014] The barycenter calculation processing unit can obtain theparameter values at the time when the barycenter lies within apredetermined threshold value including ⅓.

[0015] The above and other objects and features of the present inventionwill become apparent from the following detailed description and theappended claims with reference to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0016]FIG. 1 is a block diagram of an image converting apparatusaccording to an embodiment 1;

[0017]FIG. 2 is a diagram showing conversion chromaticity coordinatevalues (R′, G′, B′);

[0018]FIG. 3 is a diagram showing 2-dimensional conversion chromaticitycoordinate values (r′, g′);

[0019]FIG. 4 is a diagram showing a color region;

[0020]FIG. 5 is a flowchart showing the operation of the imageconverting apparatus according to the embodiment 1;

[0021]FIG. 6 is a diagram showing spectral distribution of an idealwhite light source;

[0022]FIG. 7 is a block diagram of an image converting apparatusaccording to an embodiment 2; and

[0023]FIG. 8 is a flowchart showing the operation of the imageconverting apparatus according to the embodiment 2.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0024] Embodiments of the invention will be described in detailhereinbelow with reference to the drawings.

[0025] <Embodiment 1>

[0026]FIG. 1 is a block diagram of an image converting apparatus 10according to an embodiment 1.

[0027] The image converting apparatus 10 comprises: an input imageholding unit 11 which holds an input image, that is, image data to beconverted; a parameter setting unit 12 which sets predeterminedparameters for converting the image data held in the input image holdingunit 11; a chromaticity coordinate converting unit 13 which obtainsconversion chromaticity coordinate values by converting chromaticitycoordinate values showing a color of each pixel of the image data on thebasis of the parameters set by the parameter setting unit 12; a colorregion obtaining unit 14 which obtains a region, as a color region,including 2-dimensional conversion chromaticity coordinate values, in aconvex polygonal shape, obtained by projecting the conversionchromaticity coordinate values formed by the chromaticity coordinateconverting unit 13 onto a unit plane so that additive color mixture canbe performed; an area calculation processing unit 15 which calculates anarea of the color region obtained by the color region obtaining unit 14and obtains parameter values at the time when the calculated areabecomes the maximum; and an image converting unit 16 which converts theinput image data by using the parameter values obtained by the areacalculation processing unit 15.

[0028] Subsequently, each unit will be explained.

[0029] The input image holding unit 11 holds image data of an objectphotographed by a digital camera or the like. The image data isconstructed by a plurality of pixels and each pixel is shown by the RGBcalorimetric system which has conventionally been known.

[0030] The parameter setting unit 12 performs a conversion to (R, G, B)values of the pixel on a pixel unit basis of the image data held in theinput image holding unit 11 by using coefficients (ρ, γ, β) of threechannels as parameter values. Values of ρ, γ, and β are changed atpredetermined sampling intervals within ranges of 0<ρ<ρ_(max),0<γ<γ_(max), and 0<β<β_(max), respectively.

[0031] For example, 0.05 unit is used as a sampling interval and 2 isused as values of ρ_(max), γ_(max), and β_(max). The narrower thesampling interval is and the larger the values of ρ_(max), γ_(max), andβ_(max) are set, the larger an amount of arithmetic operating processes,which will be explained hereinlater, increases. Therefore, it ispreferable to properly set them in accordance with arithmetic operatingprocessing ability.

[0032] Results obtained by executing a conversion to chromaticitycoordinate values (R, G, B) of each pixel on the basis of the parameters(ρ, γ, β) are assumed to be conversion chromaticity coordinate values(R′, G′, B′) and their relations are shown by the following equations(1).

R′=ρ·R G′=γ·G B′=β·B   (1)

[0033] When the conversion chromaticity coordinate values (R′, G′, B′)are received from the chromaticity coordinate converting unit 13, thecolor region obtaining unit 14 executes a conversion shown by thefollowing equations (2) in order to show the conversion chromaticitycoordinate values (R′, G′, B′) onto a unit plane shown by a relation(R+G+B=1).

r′=R′/(R′+G′+B′) g′=G′/(R′+G′+B′) b′=B′/(R′+G′+B′)   (2)

[0034] The relations between (r′, g′, b′) obtained by the aboveconversion and the conversion chromaticity coordinate values (R′, G′,B′) are shown in FIG. 2 in which RGB are assumed to be coordinate axes.

[0035] Further, 2-dimensional conversion chromaticity coordinate values(r′, g′) in which the obtained (r′, g′, b′) are projected onto a2-dimensional plane (2-dimensional chromaticity coordinate plane) areobtained. As shown in FIG. 3, the 2-dimensional conversion chromaticitycoordinate values (r′, g′) are projected onto a (r, g) plane shown by anR axis and a G axis. The (r, g) plane is shown by an r axis and a gaxis. An explanation will be made hereinbelow on the assumption that the2-dimensional conversion chromaticity coordinate values (r′, g′) areshown on such an rg coordinate system.

[0036] When the 2-dimensional conversion chromaticity coordinate values(r′, g′) corresponding to all pixels are obtained, as shown in FIG. 4,the color region obtaining unit 14 obtains a region, as a color region,where an outermost shell of the 2-dimensional conversion chromaticitycoordinate values (r′, g′) is surrounded by an outline showing a convexpolygon (n-angled polygon) in order to include the 2-dimensionalconversion chromaticity coordinate values (r′, g′) so that additivecolor mixture can be performed.

[0037] The color region obtained by the color region obtaining unit 14shows a color gamut which can be expressed by the image data to whichthe conversion has been made by using the parameters. In the convertedimage data, therefore, the color region shows a color gamut of thecolors which are used in the image data. Even in the image data of anobject which is unbalanced in color arrangement, for example, a bluishobject to be photographed, the blue color is not particularly reflectedto the image data but the color region simply shows a color gamut of thecolors which are used in the image data.

[0038] After the color region is obtained, the area calculationprocessing unit 15 obtains an area of the color region. The area of thecolor region is shown by the following equation (3). $\begin{matrix}{S = {\frac{1}{2}\left\lbrack {{\begin{matrix}r_{1}^{\prime} & g_{1}^{\prime} \\r_{2}^{\prime} & g_{2}^{\prime}\end{matrix}} + {\begin{matrix}r_{2}^{\prime} & g_{2}^{\prime} \\r_{3}^{\prime} & g_{3}^{\prime}\end{matrix}} + \cdots + {\begin{matrix}r_{n}^{\prime} & g_{n}^{\prime} \\r_{1}^{\prime} & g_{1}^{\prime}\end{matrix}}} \right\rbrack}} & (3)\end{matrix}$

[0039] where, n: the number of vertices of a polygon showing the colorregion

[0040] The area of the color region is calculated by using the followingequation (4) obtained by further converting the equation (3).$\begin{matrix}{S = {\frac{1}{2}{\sum\limits_{i = 1}^{n}\frac{{\rho \cdot r_{i}^{\prime}} + {\gamma \cdot g_{i + 1}^{\prime}} - {\rho \cdot r_{i + 1}^{\prime}} + {\gamma \cdot g_{i}^{\prime}}}{\left( {{\rho \cdot r_{i}^{\prime}} + {\gamma \cdot g_{i}^{\prime}} + {\beta \cdot b_{i}^{\prime}}} \right)\left( {{\rho \cdot r_{i + 1}^{\prime}} + {\gamma \cdot g_{i + 1}^{\prime}} + {\beta \cdot b_{i + 1}^{\prime}}} \right)}}}} & (4)\end{matrix}$

[0041] If the calculated area is larger than an area held in a storingunit (not shown), the area calculation processing unit 15 holds thecalculated area into the storing unit. Such a series of processes isrepeated for each of the various parameters set by the parameter settingunit 12. Therefore, areas of the color regions corresponding to all ofthe parameters are calculated and the maximum value of the calculatedareas of the color regions is held in the storing unit. At this time,together with the maximum value, the parameter values (ρ, γ, β)corresponding to the color region of the maximum area are held in thestoring unit.

[0042] When the area value is calculated for the first time, since thearea value to be compared with is not held in the storing unit, the areacalculation processing unit 15 holds the area value of the color regionand the parameter values (ρ, γ, β) set by the parameter setting unit 12into the storing unit without making the comparison of the area values.

[0043] Since the color region shows the color gamut which can beexpressed by the image data to which the conversion has been made byusing the parameters as mentioned above, if the area of the color regionis large, the color gamut which can be expressed by the image data iswidened. Therefore, in image data obtained by photographing an objectunder, for example, a reddish light source serving as a colored lightsource shown in FIG. 6, the color gamut which can be expressed isnarrowed due to reddishness. However, in image data obtained byphotographing an object under the ideal white light source, since it isnot influenced by a hue of the colored light source, the color gamutwhich can be expressed, that is, the area of the color region iswidened.

[0044] Further, the color region is not much influenced by the colorarrangement balance of the object. The parameter values (ρ, γ, β)obtained on the basis of the area of the color region are not directlyinfluenced by the color arrangement balance of the object either.

[0045] The image converting unit 16 executes a conversion to the imagedata held in the input image holding unit 11 by using the parametervalues (ρ, γ, β) held in the storing unit mentioned above, that is, theparameter values in which the area of the color region becomes themaximum. Owing to such a conversion, the image data is converted toobtain a state as if the object were photographed under the ideal whitelight source.

[0046] Subsequently, the operation of the image converting apparatus 10of the invention will be described with reference to a flowchart of FIG.5.

[0047] Image data of an object photographed by a digital camera or thelike is obtained as an input image and held in the input image holdingunit 11 (step S11).

[0048] The chromaticity coordinate converting unit 13 executes aconversion to the chromaticity coordinate values (R, G, B) of each pixelof the image data held in the input image holding unit 11 by using theparameters (ρ, γ, β) set by the parameter setting unit 12, therebyobtaining the conversion chromaticity coordinate values (R′, G′, B′)(step S12).

[0049] After the conversion chromaticity coordinate values (R′, G′, B′)are obtained, the color region obtaining unit 14 projects the conversionchromaticity coordinate values (R′, G′, B′) onto the (r, g) plane as aunit plane, thereby obtaining the 2-dimensional conversion chromaticitycoordinate values (r′, g′) (step S13).

[0050] Further, the color region obtaining unit 14 obtains a convexpolygonal region, as a color region, including the 2-dimensionalconversion chromaticity coordinate values (r′, g′) plotted onto the (r,g) plane so that additive color mixture can be performed (step S14).

[0051] After the color region is obtained, the area of the color regionis calculated by the area calculation processing unit 15 by using theequation (4) (step S15).

[0052] The area calculation processing unit 15 compares the calculatedarea with the area value held in the storing unit not shown in FIG. 1(step S16).

[0053] By this comparison, if the area calculated this time is largerthan the area value held in the storing unit, contents in the storingunit are updated on the basis of the area value of the color regioncalculated this time and the parameter values corresponding to the colorregion (step S17). Therefore, the storing unit holds the area value ofthe maximum color region among the area values of the color regionsobtained with respect to the various parameters and the parameter valueswhich correspond to such an area value and were used when the conversionis performed to the image data by the chromaticity coordinate convertingunit 13.

[0054] On the other hand, if the area calculated this time is equal toor smaller than the area value held in the storing unit, the areacalculation processing unit 15 executes a process in step S18 withoutupdating the contents held in the storing unit.

[0055] In the process in step S18, whether the comparison between thearea of each color region obtained every parameter and the value held inthe storing unit has been finished or not is discriminated. That is, theparameters (ρ, γ, β) are changed at predetermined sampling intervalswithin the ranges of 0<ρ<ρ_(max), 0<γ<γ_(max), and 0<β<β_(max),respectively, and in the color regions in all of the changed parameters,whether the maximum area value among the color regions has completelybeen obtained or not is discriminated (step S18).

[0056] As a result of the discrimination, if the processes for obtainingand comparing the area values of the color regions are not finished yetwith respect to all of the parameters, the processing routine isreturned to the process in step S11. The parameters (ρ, γ, β) arechanged at the predetermined sampling intervals by the parameter settingunit 12 and the processes are executed in a manner similar to thosementioned above.

[0057] After the maximum area value is obtained, the image convertingunit 16 executes a conversion to the image data held in the input imageholding unit 11 by using the parameter values corresponding to the colorregion of the maximum area value held in the storing unit.

[0058] According to the image converting apparatus 10 of the invention,therefore, by obtaining the parameter values (ρ, γ, β) in which the areaof the color region becomes the maximum and executing the conversion tothe image data by using the obtained parameter values (ρ, γ, β), theimage data in which the color gamut which is expressed is narrowed dueto the influence of the colored light source can be converted into theimage data in which the color gamut which is expressed becomes widest,that is, the image data obtained under the ideal white light source.

[0059] Further, according to the image converting apparatus 10 of theinvention, the parameter values (ρ, γ, β) are obtained on the basis ofthe area of the color region showing the color gamut which can beexpressed by the image data to be converted without being directlyinfluenced by the color arrangement balance of the object. Therefore, adrawback such that the image data is influenced by the degrees of thechromaticity coordinate values of each pixel of the image data to beconverted as in the case of the conventional gray world is eliminated.Thus, the image conversion can be properly executed even to the imagedata obtained by photographing the object which is unbalanced in colorarrangement.

[0060] <Embodiment 2>

[0061] As mentioned above, in the conventional gray world, thecorrection is made by using the average values of the chromaticitycoordinate values of each pixel of the image data. Therefore, since thefrequency of occurrence of the expressing color is considered, the imagedata obtained by photographing the object which is unbalanced in colorarrangement cannot be properly corrected. In the color region as afeature of the invention, the frequency of occurrence of the expressingcolor is not considered but the color region shows the color gamutexpressed in the image data. Therefore, since the foregoing degrees arenot reflected to such a color region, the degrees are not reflected to abarycenter of the color region either.

[0062] According to the embodiment 2, parameters in which the barycenterof the color region to which the degrees are not reflected is set to ⅓are obtained.

[0063]FIG. 7 is a block diagram of an image converting apparatus 20according to the embodiment 2.

[0064] The image converting apparatus 20 of the embodiment 2 has aconstruction using a barycenter calculation processing unit 17 in placeof the area calculation processing unit 15 in the embodiment 1.

[0065] The image converting apparatus 20 comprises: the input imageholding unit 11 which holds the image data to be converted; theparameter setting unit 12 which sets the various parameters (ρ, γ, β)for executing the conversion to the image data held in the input imageholding unit 11; the chromaticity coordinate converting unit 13 whichobtains the conversion chromaticity coordinate values (R′, G′, B′) byconverting the chromaticity coordinate values showing the color of eachpixel of the image data on the basis of the parameters set by theparameter setting unit 12; the color region obtaining unit 14 whichobtains a region, as a color region, including the 2-dimensionalconversion chromaticity coordinate values (r′, g′), in a convexpolygonal shape, obtained by projecting the conversion chromaticitycoordinate values formed by the chromaticity coordinate converting unit13 onto the unit plane so that the additive color mixture can beperformed; the barycenter calculation processing unit 17 whichcalculates the barycenter of the color region obtained by the colorregion obtaining unit 14 and obtains parameter values at the time whenthe calculated barycenter lies within a predetermined threshold valueincluding ⅓; and the image converting unit 16 which converts the imagedata by using the parameter values obtained by the barycentercalculation processing unit 17.

[0066] Since the input image holding unit 11, parameter setting unit 12,chromaticity coordinate converting unit 13, color region obtaining unit14, and image converting unit 16 are the same as those in the embodiment1 mentioned above, their description is omitted here.

[0067] The barycenter calculation processing unit 17 obtains theparameters (ρ, γ, β) at the time when the barycenter of the color regionobtained by the color region obtaining unit 14 lies within thepredetermined threshold value including ⅓. The image data obtained underthe ideal white light source can be obtained by converting the imagedata by using the obtained parameters as will be explained by usingequations.

[0068] In the color region shown in FIG. 4, although the area of thecolor region influenced by the colored light source is narrowed, sincethe image data obtained by photographing the object under the idealwhite light source is not influenced by the hue of the colored lightsource, the color gamut which is expressed, that is, the color regionbecomes the maximum. The parameter values (ρ, γ, β) of a relation shownin the following equation (5) are obtained in order to maximize an areaS of the color region.

∂S/∂ρ=∂S/∂γ=∂S/∂β=0   (5)

[0069] First, a partial differentiation of the area S shown in theequation (4) is executed with respect to ρ and γ, thereby obtaining thefollowing equations (6) and (7). $\begin{matrix}{\frac{\partial S}{\partial\rho} = {\frac{1}{2}{\sum\limits_{i = 1}^{n}\frac{\left( {1 - r_{i}^{\prime} - r_{i + 1}^{\prime}} \right)\left( {{r_{i}^{\prime} \cdot g_{i + 1}^{\prime}} - {r_{i + 1}^{\prime} \cdot g_{i}^{\prime}}} \right)}{\rho}}}} & (6) \\{\frac{\partial S}{\partial\gamma} = {\frac{1}{2}{\sum\limits_{i = 1}^{n}\frac{\left( {1 - g_{i}^{\prime} - g_{i + 1}^{\prime}} \right)\left( {{r_{i}^{\prime} \cdot g_{i + 1}^{\prime}} - {r_{i + 1}^{\prime} \cdot g_{i}^{\prime}}} \right)}{\gamma}}}} & (7)\end{matrix}$

[0070] where, n: the number of vertices of the polygon showing the colorregion

[0071] The equations (6) and (7) indicate the extremal parameter values(ρ and γ) at the time when the area is maximized, respectively. When∂S/∂ρ=0 and ∂S/∂γ=0 are satisfied, a sum of numerators of the equations(6) and (7) is equal to 0. Thus, the following equations (8) and (9) areobtained by rearranging the equations (6) and (7). $\begin{matrix}{{\sum\limits_{i = 1}^{n}{\left( {r_{i}^{\prime} + r_{i + 1}^{\prime}} \right)\left( {{r_{i}^{\prime} \cdot g_{i + 1}^{\prime}} - {r_{i + 1}^{\prime} \cdot g_{i}^{\prime}}} \right)}} = {\sum\limits_{i = 1}^{n}\left( {{r_{i}^{\prime} \cdot g_{i + 1}^{\prime}} - {r_{i + 1}^{\prime} \cdot g_{i}^{\prime}}} \right)}} & (8) \\{{\sum\limits_{i = 1}^{n}{\left( {g_{i}^{\prime} + g_{i + 1}^{\prime}} \right)\left( {{r_{i}^{\prime} \cdot g_{i + 1}^{\prime}} - {r_{i + 1}^{\prime} \cdot g_{i}^{\prime}}} \right)}} = {\sum\limits_{i = 1}^{n}\left( {{r_{i}^{\prime} \cdot g_{i + 1}^{\prime}} - {r_{i + 1}^{\prime} \cdot g_{i}^{\prime}}} \right)}} & (9)\end{matrix}$

[0072] According to the equation (3), a right side of each of theequations (8) and (9) indicates a double area of the color region.Therefore, the equations (8) and (9) are simplified to the followingequations (10) and (11). $\begin{matrix}{{\sum\limits_{i = 1}^{n}{\left( {r_{i}^{\prime} + r_{i + 1}^{\prime}} \right)\left( {{r_{i}^{\prime} \cdot g_{i + 1}^{\prime}} - {r_{i + 1}^{\prime} \cdot g_{i}^{\prime}}} \right)}} = {2 \cdot S}} & (10) \\{{\sum\limits_{i = 1}^{n}{\left( {g_{i}^{\prime} + g_{i + 1}^{\prime}} \right)\left( {{r_{i}^{\prime} \cdot g_{i + 1}^{\prime}} - {r_{i + 1}^{\prime} \cdot g_{i}^{\prime}}} \right)}} = {2 \cdot S}} & (11)\end{matrix}$

[0073] Coordinate values showing the barycenter of the color region areshown by the following equations (12) and (13). $\begin{matrix}{r_{c}^{\prime} = {\frac{1}{6}\frac{\sum\limits_{i = 1}^{n}{\left( {r_{i}^{\prime} + r_{i + 1}^{\prime}} \right)\left( {{r_{i}^{\prime} \cdot g_{i + 1}^{\prime}} - {r_{i + 1}^{\prime} \cdot g_{i}^{\prime}}} \right)}}{S}}} & (12) \\{g_{c}^{\prime} = {\frac{1}{6}\frac{\sum\limits_{i = 1}^{n}{\left( {g_{i}^{\prime} + g_{i + 1}^{\prime}} \right)\left( {{r_{i}^{\prime} \cdot g_{i + 1}^{\prime}} - {r_{i + 1}^{\prime} \cdot g_{i}^{\prime}}} \right)}}{S}}} & (13)\end{matrix}$

[0074] By substituting the equation (10) into the equation (12), thefollowing equation (14) is obtained and by substituting the equation(11) into the equation (13), the following equation (15) is obtained.

r′_(c)=⅓  (14)

g′_(c)=⅓  (15)

[0075] A barycenter (r′_(c), g′_(c)) of the color region whose area ismaximized is set to ⅓.

[0076] On the other hand, as is known hitherto, when the colors of R, G,and B each having an equal amount are mixed (additive color mixture), awhite color is shown. In the above color mixture, if the colors of R, G,and B of the maximum values of the equal amount (R=G=B) are mixed so asnot to cause a spot in spectral distribution (that is, so as to obtainflat spectral distribution), an ideal white light source is obtained. Insuch an ideal white light source called a flat white light source, sincethe colors of R, G, and B of the equal amount are uniformly mixed, arelation shown by the following equations (16) is satisfied.

R/(R+G+B)=⅓ G/(R+G+B)=⅓ B/(R+G+B)=⅓  (16)

[0077] When the relation shown by the equations (16) is shown bycoordinates on a unit plane of (R+G+B=1), each value of R, G, and Bindicates ⅓ and it coincides with the barycenter of the color regionmentioned above. In other words, the barycenter of the color region ofthe ideal white light source is also set to ⅓.

[0078]FIG. 4 shows a barycenter (C) of the color region mentioned above.FIG. 4 also shows chromaticity coordinate values P obtained by theconventional gray world. The chromaticity coordinate values of eachpixel are shown by a dot in the color region shown in FIG. 4. Accordingto the gray world which takes into consideration of the frequency ofoccurrence of the chromaticity coordinate values of each pixel, in theimage data having a deviation of each dot (chromaticity coordinatevalues of each pixel) shown in FIG. 4, that is, the image data obtainedby photographing the object which is unbalanced in color arrangement,the coordinate values P which are away from the coordinate values Cindicative of the barycenter of the color region of the ideal whitelight source are shown.

[0079] Subsequently, the operation of the image converting apparatus 20of the embodiment 2 will be described with reference to a flowchart ofFIG. 8.

[0080] Image data of an object photographed by a digital camera or thelike is obtained as an input image and held in the input image holdingunit 11 (step S21).

[0081] The chromaticity coordinate converting unit 13 executes aconversion to the chromaticity coordinate values (R, G, B) of each pixelof the image data held in the input image holding unit 11 by using theparameters (ρ, γ, β) set by the parameter setting unit 12, therebyobtaining the conversion chromaticity coordinate values (R′, G′, B′)(step S22).

[0082] After the conversion chromaticity coordinate values (R′, G′, B′)are obtained, the color region obtaining unit 14 projects the conversionchromaticity coordinate values (R′, G′, B′) onto the (r, g) plane as aunit plane, thereby obtaining the 2-dimensional conversion chromaticitycoordinate values (r′, g′) (step S23).

[0083] Further, the color region obtaining unit 14 obtains a convexpolygonal region, as a color region, where the 2-dimensional conversionchromaticity coordinate values (r′, g′) plotted onto the (r, g) planeare included so that additive color mixture can be performed (step S24).

[0084] After the color region is obtained, coordinates of the barycenterof the color region is calculated by the barycenter calculationprocessing unit 17 by using the above equations (step S25).

[0085] Further, the barycenter calculation processing unit 17discriminates whether the calculated coordinates of the barycenter liewithin a predetermined threshold value or not as shown by the followinginequalities (17) (step S26).

|r′_(c)−⅓|<ε_(r) |g′_(c)−⅓|<ε_(g)   (17)

[0086] where, ε_(r):threshold value of the r coordinate

[0087] ε_(g):threshold value of the g coordinate

[0088] At this time, the barycenter calculation processing unit 17obtains the parameter values (ρ, γ, β) set by the parameter setting unit12.

[0089] By this discrimination, if the calculated coordinates of thebarycenter are out of the range shown by the inequalities (17), theprocessing routine is returned to the process in step S21. Theparameters (ρ, γ, β) are changed at predetermined sampling intervals bythe parameter setting unit 12 and the above processes are similarlyexecuted.

[0090] If the calculated coordinates of the barycenter of the colorregion are within the range shown by the inequalities (17), the imageconverting unit 16 executes a conversion to the image data held in theinput image holding unit 11 by using the parameter values correspondingto the color region where the barycenter lies within the predeterminedthreshold value including ⅓, that is, the parameter values (ρ, γ, β)obtained from the parameter setting unit 12 in step S26. Thus, thecoordinate values showing the barycenter of the color region are set toa new coordinate origin and the conversion is executed to the inputimage.

[0091] As mentioned above, according to the image converting apparatus20 of the invention, the parameter values (ρ, γ, β) in which thebarycenter at the time when the area of the color region showing thecolor gamut of the image data to be converted is maximized lies withinthe predetermined threshold value including ⅓ are obtained and theconversion is performed to the image data by using the obtainedparameter values (ρ, γ, β). Therefore, since the degrees of thechromaticity coordinate values of each pixel of the image data are notconsidered, even the image data obtained by photographing the objectwhich is unbalanced in color arrangement can be converted into the imagedata obtained by photographing the object under the ideal white lightsource.

[0092] In the foregoing embodiments, the convex polygonal color regionincluding the 2-dimensional conversion chromaticity coordinate values(r′, g′) is obtained every parameters (ρ, γ, β) which are set to variousvalues so that the additive color mixture can be performed. However, itis also possible that initial states of the parameters (ρ, γ, β) areassumed to be ρ=1, γ=1, and β=1, coordinate values of each vertex of thecolor region in those parameters are obtained, a vertex coordinateholding unit for holding those coordinate values is provided, and thearithmetic operations which have conventionally been known are executedby using the obtained coordinate values in the initial states. Thus, thearithmetic operating processes for converting the image data by usingthe parameters every various parameters (ρ, γ, β) and obtaining thecolor region where the converted chromaticity coordinate values areprojected onto the unit plane can be omitted.

[0093] As mentioned above, in the color region including the2-dimensional conversion chromaticity coordinate values obtained byprojecting the conversion chromaticity coordinate values obtained byconverting each pixel of the input image by using the parameters ontothe unit plane so that the additive color mixture can be performed, theparameter values in which the area of the color region becomes themaximum or the parameter values in which the barycenter at the time whenthe area of the color region is maximized is set to ⅓ are obtained andthe chromatic coordinate conversion is performed to the input image byusing the obtained parameter values. Thus, since the degrees of thechromatic coordinate values of each pixel of the image data are notconsidered, even the image data obtained by photographing the objectwhich is unbalanced in color arrangement can be converted into the imagedata obtained under the ideal white light source.

[0094] The present invention is not limited to the foregoing embodimentsbut many modifications and variations are possible within the spirit andscope of the appended claims of the invention.

What is claimed is:
 1. An image converting method comprising the stepsof: converting chromaticity coordinate values which each pixel of aninput image consisting of a plurality of pixels has into a 2-dimensionalchromaticity coordinate plane and obtaining 2-dimensional conversionchromaticity coordinate values of each pixel; obtaining an outline of acolor region defined by the 2-dimensional conversion chromaticitycoordinate values of said plurality of pixels converted into said2-dimensional chromaticity coordinate plane; obtaining 2-dimensionalconversion chromaticity coordinate values, on a 2-dimensionalchromaticity coordinate plane, of a barycenter of an area of a regionwhich is specified by the outline of said color region; and executing acolor conversion of the input image by using the 2-dimensionalconversion chromaticity coordinate values of said barycenter as a newcoordinate origin.
 2. An image converting method comprising the stepsof: converting each pixel of an input image into 2-dimensionalconversion chromaticity coordinate values which are obtained byprojecting conversion chromaticity coordinate values obtained byconverting each of said pixels by using parameters for converting inchromaticity coordinates onto a unit plane, and in a color regionincluding said 2-dimensional conversion chromaticity coordinate values,obtaining parameter values in which an area of said color region becomesthe maximum; and converting said input image by said obtained parametervalues.
 3. An image converting method comprising the steps of:converting each pixel of an input image into 2-dimensional conversionchromaticity coordinate values which are obtained by projectingconversion chromaticity coordinate values obtained by converting each ofsaid pixels by using parameters for converting in chromaticitycoordinates onto a unit plane, and obtaining parameter values in which abarycenter of a color region including said 2-dimensional conversionchromaticity coordinate values is set to ⅓; and converting the inputimage by said obtained parameter values.
 4. The method according toclaim 3, wherein the parameter values at the time when the barycenterlies within a predetermined threshold value including ⅓ are obtained. 5.An image converting apparatus comprising: a parameter setting unit whichsets parameters for converting each pixel of an input image intopredetermined chromaticity coordinate values; a chromaticity coordinateconverting unit which obtains conversion chromaticity coordinate valuesobtained by converting each of said pixels on the basis of theparameters set by said parameter setting unit; a color region obtainingunit which obtains a color region including 2-dimensional conversionchromaticity coordinate values obtained by projecting each of saidconversion chromaticity coordinate values onto a unit plane; an areacalculation processing unit which calculates an area of said colorregion with respect to the parameters and obtains parameter values atthe time when a value of the calculated area becomes the maximum; and animage converting unit which converts said input image on the basis ofthe obtained parameter values.
 6. An image converting apparatuscomprising: a parameter setting unit which sets parameters forconverting each pixel of an input image into predetermined chromaticitycoordinate values; a chromaticity coordinate converting unit whichobtains conversion chromaticity coordinate values obtained by convertingeach of said pixels on the basis of the parameters set by said parametersetting unit; a color region obtaining unit which obtains a color regionincluding 2-dimensional conversion chromaticity coordinate valuesobtained by projecting each of said conversion chromaticity coordinatevalues onto a unit plane so that additive color mixture can beperformed; a barycenter calculation processing unit which calculates abarycenter of said color region with respect to the parameters andobtains parameter values at the time when the calculated barycenter isset to ⅓; and an image converting unit which converts said input imageon the basis of the obtained parameter values.
 7. The apparatusaccording to claim 6, wherein said barycenter calculation processingunit obtains the parameter values at the time when the barycenter lieswithin a predetermined threshold value including ⅓.